package com.example.dzbsh.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.example.dzbsh.dao.RenyuanMapper;
import com.example.dzbsh.model.Renyuan;
import com.example.dzbsh.model.RenyuanExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class RenyuanService {
	
	@Resource
    RenyuanMapper ddMapper;

    public int  modifyDept(String ppDeptname,String ppJigoumingchengma,String ppGuanliDeptId,String ppOldDeptname,String ppOldJigoumingchengma){
        Renyuan mmRenyuan = new Renyuan();
        mmRenyuan.setJigoumingchengma(ppJigoumingchengma);
        mmRenyuan.setDeptname(ppDeptname);
        mmRenyuan.setGuanlideptid(ppGuanliDeptId);
        RenyuanExample mmExample = new RenyuanExample();
        RenyuanExample.Criteria criteria= mmExample.createCriteria();
        criteria.andJigoumingchengmaEqualTo(ppOldJigoumingchengma).andDeptnameEqualTo(ppOldDeptname);
	    return ddMapper.updateByExampleSelective(mmRenyuan,mmExample);
    }

	// 查询人员表包含的单位名称和机构名称码
    public List<Map<String,Object>> findJigoumaAndDeptname(String ppDeptName,String ppJigoumingchengma){
        if(ppDeptName!=null&&!ppDeptName.equals("")){
            ppDeptName= "%"+ppDeptName+"%";
        }
        if(ppJigoumingchengma!=null&&!ppJigoumingchengma.equals("")){
            ppJigoumingchengma= "%"+ppJigoumingchengma+"%";
        }

        return ddMapper.FindJigoumaAndDeptname(ppDeptName,ppJigoumingchengma);
    }

    public Integer getCustomCountByDeptId(String ppDeptId) {
        Object mmCount = ddMapper.getCustomCountByDeptId(ppDeptId);
        return mmCount == null ? 0 : Integer.parseInt(mmCount.toString());
    }

    public Integer getCustomCountByGuanliDeptId(String ppDeptId,String ppRenyuanLeibieId,String ppJigoumingchengma) {
        Object mmCount = ddMapper.getCustomCountByGuanliDeptId(ppDeptId,ppRenyuanLeibieId,ppJigoumingchengma);
        return mmCount == null ? 0 : Integer.parseInt(mmCount.toString());
    }
    public Integer getCustomCountByDeptIdByGuifan(String ppDeptId,String ppRenyuanleibieId,String ppJigoumingchengma) {
        Object mmCount = ddMapper.getCustomCountByDeptIdByGuifan(ppDeptId,ppRenyuanleibieId,ppJigoumingchengma);
        return mmCount == null ? 0 : Integer.parseInt(mmCount.toString());
    }


    public List<Map<String, Object>> findCustomRenyuanByvalid(String ppDeptID,String ppTrueName,String ppRenyuanleibie,String ppShuliang,String ppJigoumingchengma,String ppPaixu,int ppPageIndex, int ppPageSize){

        int mmStartIndex = (ppPageIndex - 1) * ppPageSize;
        String mmTrueName = "%"+ppTrueName+"%";

        return ddMapper.findCustomRenyuanByvalid(ppDeptID,mmTrueName,ppRenyuanleibie,ppShuliang,ppJigoumingchengma,ppPaixu,mmStartIndex,ppPageSize);

    }

    public Renyuan findOne(String pprenyuanID){
        return ddMapper.selectByPrimaryKey(pprenyuanID);
    }

    public List<Map<String,Object>> findByDeptId(String ppDeptId,String ppRenyuanleibie,String ppJigoumingchengma,String ppPaixu){
        return ddMapper.findByDeptId(ppDeptId,ppRenyuanleibie,ppJigoumingchengma,ppPaixu);
    }

    // 通过单位id查询领导信息 带分页
    public List<Map<String, Object>> findCustomRenyuanByDeptId(String ppDeptId,String ppRenyuanleibieId,String ppJigoumingchengma,String ppPaixu,int ppPageIndex, int ppPageSize){

        int mmStartIndex = (ppPageIndex - 1) * ppPageSize;
        return ddMapper.findCustomRenyuanByDeptId(ppDeptId,ppRenyuanleibieId,ppJigoumingchengma,ppPaixu,mmStartIndex,ppPageSize);

    }
    // 通过单位id查询规范落实的领导信息 带分页
    public List<Map<String, Object>> findCustomRenyuanByDeptIdByGuifan(String ppDeptId,String ppRenyuanleibieId,String ppJigoumingchengma,String ppPaixu,int ppPageIndex, int ppPageSize){

        int mmStartIndex = (ppPageIndex - 1) * ppPageSize;
        return ddMapper.findCustomRenyuanByDeptIdByGuifan(ppDeptId,ppRenyuanleibieId,ppJigoumingchengma,ppPaixu,mmStartIndex,ppPageSize);

    }

    public Integer getCustomCountByvalid(String ppDeptID,String ppTrueName,String ppRenyuanleibie,String ppShuliang,String ppJigoumingchengma,int ppPageIndex, int ppPageSize) {
        String mmTrueName = "%"+ppTrueName+"%";
        Object mmCount = ddMapper.getCustomCountByvalid(ppDeptID,mmTrueName,ppRenyuanleibie,ppShuliang,ppJigoumingchengma,ppPageIndex,ppPageSize);
        return mmCount == null ? 0 : Integer.parseInt(mmCount.toString());
    }

    public List<Map<String, Object>> findVaild(int ppPageIndex, int ppPageSize){

        int mmStartIndex = (ppPageIndex - 1) * ppPageSize;

        return ddMapper.findRenyuanByvalid(mmStartIndex, ppPageSize);

    }
    public Integer getCountByisvalid() {
        Object mmCount = ddMapper.getCountByzhuangtai();
        return mmCount == null ? 0 : Integer.parseInt(mmCount.toString());
    }

    public boolean delete(String pprenyuanID){
        return ddMapper.deleteByPrimaryKey(pprenyuanID)==1;
    }

    public List<Map<String, Object>> isZhengjianhaomaExist(String ppZhengjianhaoma) {

        return ddMapper.isZhengjianhaomaExist(ppZhengjianhaoma);
    }

    public List<String> selectDepNameByValid(){ return ddMapper.selectDepNameByValid();};

    public Integer getCountByJunxianAndCengji(String ppRemyuanleibie,String ppJunxiandengji,String ppZhiwucengji, String ppDeptId,String ppShifoujingshang) {
        Object mmCount = ddMapper.getCountByJunxianAndCengji(ppRemyuanleibie,ppJunxiandengji,ppZhiwucengji,ppDeptId,ppShifoujingshang);
        return mmCount == null ? 0 : Integer.parseInt(mmCount.toString());
    }

    public Integer getGuifanCountByJunxianAndCengjiAndTuichuLeixing(String ppRemyuanleibie,String ppJunxiandengji,String ppZhiwucengji,String ppDeptId, int ppTuichuleixing) {
        Object mmCount = ddMapper.getGuifanCountByJunxianAndCengjiAndTuichuLeixing(ppRemyuanleibie,ppJunxiandengji,ppZhiwucengji,ppDeptId,ppTuichuleixing);
        return mmCount == null ? 0 : Integer.parseInt(mmCount.toString());
    }

    public Map<String,Object> findTongjibiao(){
        Map<String,Object> mmMap = new HashMap<>();
        int mmShangjiangJingshang = getCountByJunxianAndCengji("1","1","3","","1");
        int mmShangjiangQuanbu = getCountByJunxianAndCengji("1","1","3","","2");
        int mmZhongjiangJingshang = getCountByJunxianAndCengji("1","2","4","","1");
        int mmZhongjiangQuanbu = getCountByJunxianAndCengji("1","2","4","","2");
        int mmShaojiangZhengJingshang = getCountByJunxianAndCengji("1","3","5","","1");
        int mmShaojiangZhengQuanbu = getCountByJunxianAndCengji("1","3","5","","2");
        int mmShaojiangFuJingshang = getCountByJunxianAndCengji("1","3","6","","1");
        int mmShaojiangFuQuanbu = getCountByJunxianAndCengji("1","3","6","","2");

        // 军官
        int mmDaxiaoZhengJingshang = getCountByJunxianAndCengji("1","4","7","","1");
        int mmDaxiaoZhengQuanbu = getCountByJunxianAndCengji("1","4","7","","2");

        // 文职干部 正局级
        int mmWenzhiganbujujijingshang = getCountByJunxianAndCengji("2","","1","","1");
        int mmWenzhiganbujujiQuanbu = getCountByJunxianAndCengji("2","","1","","2");
        // 文职人员 局级正
        int mmWenzhijujijingshang = getCountByJunxianAndCengji("3","","1","","1");
        int mmWenzhijujiQuanbu = getCountByJunxianAndCengji("3","","1","","2");

        //职员 管理三级
        int mmGuanlisanjingshang = getCountByJunxianAndCengji("4","","1","","1");
        int mmGuanlisanQuanbu = getCountByJunxianAndCengji("4","","1","","2");

        mmDaxiaoZhengJingshang= mmDaxiaoZhengJingshang+mmWenzhiganbujujijingshang+mmWenzhijujijingshang+mmGuanlisanjingshang;
        mmDaxiaoZhengQuanbu = mmDaxiaoZhengQuanbu+mmWenzhiganbujujiQuanbu+mmWenzhijujiQuanbu+mmGuanlisanQuanbu;
        // 军官
        int mmDaxiaoFuJingshang = getCountByJunxianAndCengji("1","4","8","","1");
        int mmDaxiaoFuQuanbu = getCountByJunxianAndCengji("1","4","8","","2");

        // 文职干部 副局级
        int mmWenzhiganbufujujingshang = getCountByJunxianAndCengji("2","","2","","1");
        int mmWenzhiganbufujuQuanbu = getCountByJunxianAndCengji("2","","2","","2");
        // 文职人员 局级副
        int mmWenzhifujujingshang = getCountByJunxianAndCengji("3","","2","","1");
        int mmWenzhifujuQuanbu = getCountByJunxianAndCengji("3","","2","","2");

        //职员 管理四级
        int mmGuanlisijingshang = getCountByJunxianAndCengji("4","","2","","1");
        int mmGuanlisiQuanbu = getCountByJunxianAndCengji("4","","2","","2");

        int mmShangxiaozhengJingshang = getCountByJunxianAndCengji("1","5","9","","1");
        int mmShangxiaozhengQuanbu = getCountByJunxianAndCengji("1","5","9","","2");

        mmDaxiaoFuJingshang=mmDaxiaoFuJingshang+mmWenzhiganbufujujingshang+mmWenzhifujujingshang+mmGuanlisijingshang;
        mmDaxiaoFuQuanbu=mmDaxiaoFuQuanbu+mmWenzhiganbufujuQuanbu+mmWenzhifujuQuanbu+mmGuanlisiQuanbu;

        mmMap.put("shangjiangjingshang",mmShangjiangJingshang);
        mmMap.put("shangjiangquanbu",mmShangjiangQuanbu);
        mmMap.put("zhongjiangjingshang",mmZhongjiangJingshang);
        mmMap.put("zhongjiangquanbu",mmZhongjiangQuanbu);
        mmMap.put("shaojiangzhengjingshang",mmShaojiangZhengJingshang);
        mmMap.put("shaojiangzhengquanbu",mmShaojiangZhengQuanbu);
        mmMap.put("shaojiangfujingshang",mmShaojiangFuJingshang);
        mmMap.put("shaojiangfuquanbu",mmShaojiangFuQuanbu);
        mmMap.put("daxiaozhengjingshang",mmDaxiaoZhengJingshang);
        mmMap.put("daxiaozhengquanbu",mmDaxiaoZhengQuanbu);
        mmMap.put("daxiaofujingshang",mmDaxiaoFuJingshang);
        mmMap.put("daxiaofuquanbu",mmDaxiaoFuQuanbu);
        mmMap.put("shangxiaozhengjingshang",mmShangxiaozhengJingshang);
        mmMap.put("shangxiaozhengquanbu",mmShangxiaozhengQuanbu);
        mmMap.put("jingshang",mmShangjiangJingshang+mmZhongjiangJingshang+mmShaojiangZhengJingshang+mmShaojiangFuJingshang+mmDaxiaoZhengJingshang+mmDaxiaoFuJingshang+mmShangxiaozhengJingshang);
        mmMap.put("quanbu",mmShangjiangQuanbu+mmZhongjiangQuanbu+mmShaojiangZhengQuanbu+mmShaojiangFuQuanbu+mmDaxiaoZhengQuanbu+mmDaxiaoFuQuanbu+mmShangxiaozhengQuanbu);
        return mmMap;
    }

    public Map<String,Object> findGuifanTongjibiao(String ppDeptId){
        Map<String,Object> mmMap = new HashMap<>();

        // 经商部分统计
        int mmShangjiangJingshang = getCountByJunxianAndCengji("1","1","3",ppDeptId,"1");
        int mmShangjiangQuanbu = getCountByJunxianAndCengji("1","1","3",ppDeptId,"2");
        int mmZhongjiangJingshang = getCountByJunxianAndCengji("1","2","4",ppDeptId,"1");
        int mmZhongjiangQuanbu = getCountByJunxianAndCengji("1","2","4",ppDeptId,"2");
        int mmShaojiangZhengJingshang = getCountByJunxianAndCengji("1","3","5",ppDeptId,"1");
        int mmShaojiangZhengQuanbu = getCountByJunxianAndCengji("1","3","5",ppDeptId,"2");
        int mmShaojiangFuJingshang = getCountByJunxianAndCengji("1","3","6",ppDeptId,"1");
        int mmShaojiangFuQuanbu = getCountByJunxianAndCengji("1","3","6",ppDeptId,"2");

        // 军官
        int mmDaxiaoZhengJingshang = getCountByJunxianAndCengji("1","4","7",ppDeptId,"1");
        int mmDaxiaoZhengQuanbu = getCountByJunxianAndCengji("1","4","7",ppDeptId,"2");

        // 文职干部 正局级
        int mmWenzhiganbujujijingshang = getCountByJunxianAndCengji("2","","1",ppDeptId,"1");
        int mmWenzhiganbujujiQuanbu = getCountByJunxianAndCengji("2","","1",ppDeptId,"2");
        // 文职人员 局级正
        int mmWenzhijujijingshang = getCountByJunxianAndCengji("3","","1",ppDeptId,"1");
        int mmWenzhijujiQuanbu = getCountByJunxianAndCengji("3","","1",ppDeptId,"2");

        //职员 管理三级
        int mmGuanlisanjingshang = getCountByJunxianAndCengji("4","","1",ppDeptId,"1");
        int mmGuanlisanQuanbu = getCountByJunxianAndCengji("4","","1",ppDeptId,"2");

        mmDaxiaoZhengJingshang= mmDaxiaoZhengJingshang+mmWenzhiganbujujijingshang+mmWenzhijujijingshang+mmGuanlisanjingshang;
        mmDaxiaoZhengQuanbu = mmDaxiaoZhengQuanbu+mmWenzhiganbujujiQuanbu+mmWenzhijujiQuanbu+mmGuanlisanQuanbu;
        // 军官
        int mmDaxiaoFuJingshang = getCountByJunxianAndCengji("1","4","8",ppDeptId,"1");
        int mmDaxiaoFuQuanbu = getCountByJunxianAndCengji("1","4","8",ppDeptId,"2");

        // 文职干部 副局级
        int mmWenzhiganbufujujingshang = getCountByJunxianAndCengji("2","","2",ppDeptId,"1");
        int mmWenzhiganbufujuQuanbu = getCountByJunxianAndCengji("2","","2",ppDeptId,"2");
        // 文职人员 局级副
        int mmWenzhifujujingshang = getCountByJunxianAndCengji("3","","2",ppDeptId,"1");
        int mmWenzhifujuQuanbu = getCountByJunxianAndCengji("3","","2",ppDeptId,"2");

        //职员 管理四级
        int mmGuanlisijingshang = getCountByJunxianAndCengji("4","","2",ppDeptId,"1");
        int mmGuanlisiQuanbu = getCountByJunxianAndCengji("4","","2",ppDeptId,"2");

        int mmShangxiaozhengJingshang = getCountByJunxianAndCengji("1","5","9",ppDeptId,"1");
        int mmShangxiaozhengQuanbu = getCountByJunxianAndCengji("1","5","9",ppDeptId,"2");

        mmDaxiaoFuJingshang=mmDaxiaoFuJingshang+mmWenzhiganbufujujingshang+mmWenzhifujujingshang+mmGuanlisijingshang;
        mmDaxiaoFuQuanbu=mmDaxiaoFuQuanbu+mmWenzhiganbufujuQuanbu+mmWenzhifujuQuanbu+mmGuanlisiQuanbu;

        mmMap.put("shangjiangjingshang",mmShangjiangJingshang);
        mmMap.put("shangjiangquanbu",mmShangjiangQuanbu);
        mmMap.put("zhongjiangjingshang",mmZhongjiangJingshang);
        mmMap.put("zhongjiangquanbu",mmZhongjiangQuanbu);
        mmMap.put("shaojiangzhengjingshang",mmShaojiangZhengJingshang);
        mmMap.put("shaojiangzhengquanbu",mmShaojiangZhengQuanbu);
        mmMap.put("shaojiangfujingshang",mmShaojiangFuJingshang);
        mmMap.put("shaojiangfuquanbu",mmShaojiangFuQuanbu);
        mmMap.put("daxiaozhengjingshang",mmDaxiaoZhengJingshang);
        mmMap.put("daxiaozhengquanbu",mmDaxiaoZhengQuanbu);
        mmMap.put("daxiaofujingshang",mmDaxiaoFuJingshang);
        mmMap.put("daxiaofuquanbu",mmDaxiaoFuQuanbu);
        mmMap.put("shangxiaozhengjingshang",mmShangxiaozhengJingshang);
        mmMap.put("shangxiaozhengquanbu",mmShangxiaozhengQuanbu);
        mmMap.put("jingshang",mmShangjiangJingshang+mmZhongjiangJingshang+mmShaojiangZhengJingshang+mmShaojiangFuJingshang+mmDaxiaoZhengJingshang+mmDaxiaoFuJingshang+mmShangxiaozhengJingshang);
        mmMap.put("quanbu",mmShangjiangQuanbu+mmZhongjiangQuanbu+mmShaojiangZhengQuanbu+mmShaojiangFuQuanbu+mmDaxiaoZhengQuanbu+mmDaxiaoFuQuanbu+mmShangxiaozhengQuanbu);

        // 规范落实统计
        int mmTcShangjiangQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","1","3",ppDeptId,2);
        int mmTcShangjiangBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","1","3",ppDeptId,1);
        int mmTcShangjiangJingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","1","3",ppDeptId,0);

        int mmTcZhongjiangQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","2","4",ppDeptId,2);
        int mmTcZhongjiangBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","2","4",ppDeptId,1);
        int mmTcZhongjiangJingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","2","4",ppDeptId,0);

        int mmTcShaojiangZhengQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","3","5",ppDeptId,2);
        int mmTcShaojiangZhengBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","3","5",ppDeptId,1);
        int mmTcShaojiangZhengJingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","3","5",ppDeptId,0);

        int mmTcShaojiangFuQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","3","6",ppDeptId,2);
        int mmTcShaojiangFuBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","3","6",ppDeptId,1);
        int mmTcShaojiangFuJingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","3","6",ppDeptId,0);

        // 军官
        int mmTcDaxiaoZhengQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","4","7",ppDeptId,2);
        int mmTcDaxiaoZhengBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","4","7",ppDeptId,1);
        int mmTcDaxiaoZhengJingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","4","7",ppDeptId,0);

        // 文职干部 正局级
        int mmTcWenzhiganbujujiQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("2","","1",ppDeptId,2);
        int mmTcWenzhiganbujujiBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("2","","1",ppDeptId,1);
        int mmTcWenzhiganbujujijingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("2","","1",ppDeptId,0);

        // 文职人员 局级正
        int mmTcWenzhijujiQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("3","","1",ppDeptId,2);
        int mmTcWenzhijujiBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("3","","1",ppDeptId,1);
        int mmTcWenzhijujijingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("3","","1",ppDeptId,0);

        //职员 管理三级
        int mmTcGuanlisanQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("4","","1",ppDeptId,2);
        int mmTcGuanlisanBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("4","","1",ppDeptId,1);
        int mmTcGuanlisanjingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("4","","1",ppDeptId,0);

        mmTcDaxiaoZhengQuanbu = mmTcDaxiaoZhengQuanbu+mmTcWenzhiganbujujiQuanbu+mmTcWenzhijujiQuanbu+mmTcGuanlisanQuanbu;
        mmTcDaxiaoZhengBenren = mmTcDaxiaoZhengBenren+mmTcWenzhiganbujujiBenren+mmTcWenzhijujiBenren+mmTcGuanlisanBenren;
        mmTcDaxiaoZhengJingshang= mmTcDaxiaoZhengJingshang+mmTcWenzhiganbujujijingshang+mmTcWenzhijujijingshang+mmTcGuanlisanjingshang;

        // 军官
        int mmTcDaxiaoFuQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","4","8",ppDeptId,2);
        int mmTcDaxiaoFuBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","4","8",ppDeptId,1);
        int mmTcDaxiaoFuJingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","4","8",ppDeptId,0);

        // 文职干部 副局级
        int mmTcWenzhiganbufujuQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("2","","2",ppDeptId,2);
        int mmTcWenzhiganbufujuBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("2","","2",ppDeptId,1);
        int mmTcWenzhiganbufujujingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("2","","2",ppDeptId,0);

        // 文职人员 局级副
        int mmTcWenzhifujuQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("3","","2",ppDeptId,2);
        int mmTcWenzhifujuBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("3","","2",ppDeptId,1);
        int mmTcWenzhifujujingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("3","","2",ppDeptId,0);

        //职员 管理四级
        int mmTcGuanlisiQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("4","","2",ppDeptId,2);
        int mmTcGuanlisiBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("4","","2",ppDeptId,1);
        int mmTcGuanlisijingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("4","","2",ppDeptId,0);

        int mmTcShangxiaozhengQuanbu = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","5","9",ppDeptId,2);
        int mmTcShangxiaozhengBenren = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","5","9",ppDeptId,1);
        int mmTcShangxiaozhengJingshang = getGuifanCountByJunxianAndCengjiAndTuichuLeixing("1","5","9",ppDeptId,0);

        mmTcDaxiaoFuQuanbu=mmTcDaxiaoFuQuanbu+mmTcWenzhiganbufujuQuanbu+mmTcWenzhifujuQuanbu+mmTcGuanlisiQuanbu;
        mmTcDaxiaoFuBenren=mmTcDaxiaoFuBenren+mmTcWenzhiganbufujuBenren+mmTcWenzhifujuBenren+mmTcGuanlisiBenren;
        mmTcDaxiaoFuJingshang=mmTcDaxiaoFuJingshang+mmTcWenzhiganbufujujingshang+mmTcWenzhifujujingshang+mmTcGuanlisijingshang;

        mmMap.put("tcshangjiangbenren",mmTcShangjiangBenren);
        mmMap.put("tcshangjiangjingshang",mmTcShangjiangJingshang);
        mmMap.put("tcshangjiangquanbu",mmTcShangjiangQuanbu);
        mmMap.put("tczhongjiangbenren",mmTcZhongjiangBenren);
        mmMap.put("tczhongjiangjingshang",mmTcZhongjiangJingshang);
        mmMap.put("tczhongjiangquanbu",mmTcZhongjiangQuanbu);
        mmMap.put("tcshaojiangzhengbenren",mmTcShaojiangZhengBenren);
        mmMap.put("tcshaojiangzhengjingshang",mmTcShaojiangZhengJingshang);
        mmMap.put("tcshaojiangzhengquanbu",mmTcShaojiangZhengQuanbu);
        mmMap.put("tcshaojiangfubenren",mmTcShaojiangFuBenren);
        mmMap.put("tcshaojiangfujingshang",mmTcShaojiangFuJingshang);
        mmMap.put("tcshaojiangfuquanbu",mmTcShaojiangFuQuanbu);
        mmMap.put("tcdaxiaozhengbenren",mmTcDaxiaoZhengBenren);
        mmMap.put("tcdaxiaozhengjingshang",mmTcDaxiaoZhengJingshang);
        mmMap.put("tcdaxiaozhengquanbu",mmTcDaxiaoZhengQuanbu);
        mmMap.put("tcdaxiaofubenren",mmTcDaxiaoFuBenren);
        mmMap.put("tcdaxiaofujingshang",mmTcDaxiaoFuJingshang);
        mmMap.put("tcdaxiaofuquanbu",mmTcDaxiaoFuQuanbu);
        mmMap.put("tcshangxiaozhengbenren",mmTcShangxiaozhengBenren);
        mmMap.put("tcshangxiaozhengjingshang",mmTcShangxiaozhengJingshang);
        mmMap.put("tcshangxiaozhengquanbu",mmTcShangxiaozhengQuanbu);
        mmMap.put("tcbenren",mmTcShangjiangBenren+mmTcZhongjiangBenren+mmTcShaojiangZhengBenren+mmTcShaojiangFuBenren+mmTcDaxiaoZhengBenren+mmTcDaxiaoFuBenren+mmTcShangxiaozhengBenren);

        mmMap.put("tcjingshang",mmTcShangjiangJingshang+mmTcZhongjiangJingshang+mmTcShaojiangZhengJingshang+mmTcShaojiangFuJingshang+mmTcDaxiaoZhengJingshang+mmTcDaxiaoFuJingshang+mmTcShangxiaozhengJingshang);
        mmMap.put("tcquanbu",mmTcShangjiangQuanbu+mmTcZhongjiangQuanbu+mmTcShaojiangZhengQuanbu+mmTcShaojiangFuQuanbu+mmTcDaxiaoZhengQuanbu+mmTcDaxiaoFuQuanbu+mmTcShangxiaozhengQuanbu);
        return mmMap;
    }

    public List<String> selectRenyuanIdByDeptId(String ppDeptId){
        return ddMapper.selectRenyuanIdByDeptId(ppDeptId);
    }
}
